/**
 * Created by jiawen on 15-11-16.
 */
var app = angular.module('meanDownload', [])
    .controller("downloadController", ['$scope', '$http', '$log', function ($scope, $http, $log) {
        $scope.filename = 'file';
        $scope.files = false;

        $scope.getFiles = function () {
            console.log('click');
            $http({
                method: 'GET',
                url: 'http://localhost:3000/download/',

            }).then(function (response) {
                console.log('lol');
                $scope.files = response.data;

            }, function (response) {
                console.log('fail to fetch fileList');

            });
        };
        $scope.downloaded = false;
        $scope.download = function () {
            // var url = 'http://localhost:3000/download/' + $scope.filename;
            // $http({
            //     method: 'GET',
            //     url: url,

            // }).then(function (response) {
            //     console.log(response.data);
            //     console.log('file get');


            // }, function (response) {
            //     console.log('fail to fetch file');

            // });
        };
    }]);